package com.medical.wechat.service.impl;

import com.medical.wechat.mapper.WechatReplyTextMapper;
import com.medical.wechat.model.WechatReplyText;
import com.medical.wechat.service.WechatReplyTextService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;
import java.util.UUID;

/**
 * Created by Administrator on 2016/11/1.
 */
@Service("wechatReplyTextService")
public class WechatReplyTextServiceImpl implements WechatReplyTextService {
    @Autowired
    private WechatReplyTextMapper wechatReplyTextMapper;


    @Override
    public void createWechatReplyText(WechatReplyText wechatReplyText) {

    }

    @Override
    public List<WechatReplyText> findByAccountId(String accountId) {
        return wechatReplyTextMapper.findByAccountId(accountId);
    }

    @Override
    public void deleteById(String id) {
        wechatReplyTextMapper.deleteById(id);
    }

    @Override
    public void insert(WechatReplyText wechatReplyText) {
        String id = UUID.randomUUID().toString();
        String accountId = "1";
        String createdBy = "1";
        wechatReplyText.setId(id);
        wechatReplyText.setAccountId(accountId);
        wechatReplyText.setCreatedBy(createdBy);
        wechatReplyText.setCreatedTime(new Timestamp(System.currentTimeMillis()));
        wechatReplyTextMapper.createWechatReplyText(wechatReplyText);
    }
    public void updateById(WechatReplyText wechatReplyText){
        wechatReplyTextMapper.updateById(wechatReplyText);
    }
    public WechatReplyText findById(String id){
     return wechatReplyTextMapper.findById(id);
    }
}
